package cn.hr.entity;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;


/**
 * 文章实体类
 */
@Entity
@Table(name="tb_article"
    ,catalog="hrm"
)

public class Article  implements java.io.Serializable {


    // Fields    

     /**
	 * 
	 */
	private static final long serialVersionUID = 4245098717159361534L;
	private Long id;
     private Catalog catalog;
     private User user;
     private String title;
     private String summary;
     private String keyWord;
     private String content;
     private Date publishTime;
     private Integer hitTimes;


    // Constructors

    /** default constructor */
    public Article() {
    }

    
    /** full constructor */
    public Article(Catalog catalog, User user, String title, String summary, String keyWord, String content, Date publishTime, Integer hitTimes) {
        this.catalog = catalog;
        this.user = user;
        this.title = title;
        this.summary = summary;
        this.keyWord = keyWord;
        this.content = content;
        this.publishTime = publishTime;
        this.hitTimes = hitTimes;
    }

   
    // Property accessors
    @Id @GeneratedValue(strategy=IDENTITY)
    
    @Column(name="id", unique=true, nullable=false)

    public Long getId() {
        return this.id;
    }
    
    public void setId(Long id) {
        this.id = id;
    }
	@ManyToOne(fetch=FetchType.LAZY)
        @JoinColumn(name="catalogId", nullable=false)

    public Catalog getCatalog() {
        return this.catalog;
    }
    
    public void setCatalog(Catalog catalog) {
        this.catalog = catalog;
    }
	@ManyToOne(fetch=FetchType.LAZY)
        @JoinColumn(name="userId", nullable=false)

    public User getUser() {
        return this.user;
    }
    
    public void setUser(User user) {
        this.user = user;
    }
    
    @Column(name="title", nullable=false, length=100)

    public String getTitle() {
        return this.title;
    }
    
    public void setTitle(String title) {
        this.title = title;
    }
    
    @Column(name="summary", nullable=false, length=500)

    public String getSummary() {
        return this.summary;
    }
    
    public void setSummary(String summary) {
        this.summary = summary;
    }
    
    @Column(name="keyWord", nullable=false, length=100)

    public String getKeyWord() {
        return this.keyWord;
    }
    
    public void setKeyWord(String keyWord) {
        this.keyWord = keyWord;
    }
    
    @Column(name="content", nullable=false, length=65535)

    public String getContent() {
        return this.content;
    }
    
    public void setContent(String content) {
        this.content = content;
    }
    @Temporal(TemporalType.DATE)
    @Column(name="publishTime", nullable=false, length=0)

    public Date getPublishTime() {
        return this.publishTime;
    }
    
    public void setPublishTime(Date publishTime) {
        this.publishTime = publishTime;
    }
    
    @Column(name="hitTimes", nullable=false)

    public Integer getHitTimes() {
        return this.hitTimes;
    }
    
    public void setHitTimes(Integer hitTimes) {
        this.hitTimes = hitTimes;
    }
   








}